package com.web.main.entity.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * @create 2020-11-26 15:55
 */
@Data
@ApiModel(value = "接收前端电站对象")
public class SiteForm implements Serializable {
    public interface Add{}
    public interface Modify{}

    private static final long serialVersionUID = 1647325114147526007L;

    @ApiModelProperty(value = "充电站主键")
    @NotEmpty(message = "电桩id不能为空", groups = Modify.class)
    @Size(min = 19, max = 19, message = "主键长度为19为", groups = Modify.class)
    private String siteId;

    @ApiModelProperty(value = "充电站名字")
    @NotEmpty(message = "充电站名字不能为空", groups = Add.class)
    @Size(max = 20, message = "充电站名字最长为{max}为", groups = {Add.class, Modify.class})
    private String siteName;

    @ApiModelProperty(value = "充电站地址")
    @NotEmpty(message = "充电站地址不能为空", groups = Add.class)
    @Size(max = 40, message = "充电站地址最长为{max}为", groups = {Add.class, Modify.class})
    private String siteAddress;

    @ApiModelProperty(value = "电桩照片地址")
    @NotEmpty(message = "电桩照片不能为空", groups = Add.class)
    @Size(max = 40, message = "电桩照片地址最长为{max}为", groups = {Add.class, Modify.class})
    private String sitePiePhoto;

    @ApiModelProperty(value = "车位照片地址")
    @NotEmpty(message = "车位照片不能为空", groups = Add.class)
    @Size(max = 40, message = "车位照片地址最长为{max}为", groups = {Add.class, Modify.class})
    private String siteStallPhoto;

    @ApiModelProperty(value = "电桩全景图地址")
    @NotEmpty(message = "电桩全景图不能为空", groups = Add.class)
    @Size(max = 40, message = "电桩全景图地址最长为{max}为", groups = {Add.class, Modify.class})
    private String sitePanoramaPhoto;

    @ApiModelProperty(value = "经度")
    @NotEmpty(message = "经度不能为空", groups = Add.class)
    private String siteLongitude;

    @ApiModelProperty(value = "纬度")
    @NotEmpty(message = "纬度不能为空", groups = Add.class)
    private String siteDimensionality;

    @ApiModelProperty(value = "停车场地（0：地上，1：地下，默认0）")
    @NotNull(message = "请选择停车场地", groups = Add.class)
//    @Pattern(regexp = "^[0-1]$",  message = "请选择0:地上/1:地下", groups = {Add.class, Modify.class})
    @Min(value = 0,  message = "请选择0:地上/1:地下", groups = {Add.class, Modify.class})
    @Max(value = 1,  message = "请选择0:地上/1:地下", groups = {Add.class, Modify.class})
    private Integer sitePlace;  //^[1]([3-9])[0-9]{9}$

    @ApiModelProperty(value = "是否24小时（0：是，1：否，默认0）")
    @NotNull(message = "请选择是否24小时营业", groups = Add.class)
//    @Pattern(regexp = "^[0-1]$", message = "请选择0:是/1:否", groups = {Add.class, Modify.class})
    @Min(value = 0, message = "请选择0:是/1:否", groups = {Add.class, Modify.class})
    @Max(value = 1, message = "请选择0:是/1:否", groups = {Add.class, Modify.class})
    private Integer siteAllday;

    @ApiModelProperty(value = "备注")
    @Size(max = 200, message = "最多输入200个字", groups = {Add.class, Modify.class})
    private String siteRemark;

    @ApiModelProperty(value = "状态（0：待审批、1：使用、2：废弃、,默认0）")
    @Min(value = 0, message = "请选择0：待审批/1：使用/2：废弃", groups = {Modify.class})
    @Max(value = 2, message = "请选择0：待审批/1：使用/2：废弃", groups = {Modify.class})
    private Integer siteState;

}
